package com.tinckay.service;


import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @Author: Jean
 * @Desc:
 * @Date: 2018/11/5 19:32
 */
public interface RedisService {

    /**
     * valueSet
     *
     * @param key
     * @param value
     * @param timeout
     * @param timeUnit
     */
    void setValue(String key, Object value, long timeout, TimeUnit timeUnit);

    /**
     * 获取key对应的value
     *
     * @param key
     * @return
     */
    Object getValue(String key);

    /**
     * 移除key
     *
     * @param key
     */
    void removeKey(String key);

    /**
     * 存储map的key-value
     *
     * @param hashKey
     * @param key
     * @param value
     */
    void put(String hashKey, Object key, Object value);

    /**
     * 存储hash
     *
     * @param hashKey
     * @param map
     */
    void putAll(String hashKey, Map<Object, Object> map);

    /**
     * 获取hash
     */
    Map<String, Object> entries(Object hashKey);
}